import request from '@/utils/request'

export const getDepartments = () => {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

export const deleteDepartments = id => {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

export const addDepartments = data => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

export const getDeptDetail = id => {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

export const updateDepartments = id => {
  return request({
    url: `/company/department/${id}`,
    method: 'PUT'
  })
}
